home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 20 code / Scripting the Finder / Zawphing / Zawphing README < prev    next >
Encoding:
Text File  |  1994-10-13  |  4.1 KB  |  116 lines  |  [TEXT/MMCC]

  1. Greg Anderson
  2. First rev: March 1994
  3. Final rev: October 1994
  4.  
  5.  
  6. About the program "Zawphing"
  7. ----------------------------
  8. "Zawphing" is a program that sets the creator and file types of
  9. files selected in the Finder.  Its purpose is to demonstrate
  10. techniques of sending AppleEvents to the Scriptable Finder to do
  11. a couple of commonly desired tasks (e.g. get the list of selected
  12. items).  Zawphing is an Application, but it runs like a desk
  13. accessory; it always has a single open window, and if its window
  14. is closed, the application quits.
  15.  
  16.  
  17. Okay, what does "Zawphing" mean?
  18. --------------------------------
  19. Whenever I can't think of a suitable name for a program I'm
  20. about to start, I make up a random sound to identify it with.
  21. "Zawphing" is the sound that is made when the little wizzard
  22. zaps the creator/file type of the Finder selection.  (Playing
  23. a sound is an advanced sample left as an exercise for the
  24. reader's imagination.)  The correct pronounciation is "Zaw-PHING";
  25. "Zawph-ing" is definitely wrong.  Remember, it's a sound, not
  26. a verb.
  27.  
  28.  
  29. How the Source is organized
  30. ---------------------------
  31. Zawphing consists of a number of source files, some of which
  32. stand on their own, and some of which require support from
  33. other files in the project.  Zawphing has a mini-application
  34. framework; it's missing key important concepts such as a
  35. gApplication object, but has some useful window and menu
  36. framework code.  Former MacApp team members can't write even
  37. simple sample applications without some abstraction.  :>
  38.  
  39.  
  40. The main files that define the application "Zawphing" are:
  41.  
  42. Main.cp                    Initializes the Macintosh toolbox and
  43.                         begins execution of the application.
  44.  
  45. SetTypesOfSelection.cp    The code that actually sends AppleEvents
  46.                         to the Scriptable Finder.
  47.  
  48. SetTypesDialog.cp        This code manages the modeless dialog
  49.                         used in this application.
  50.  
  51. MenuTable.cp            A list of function pointers to routines that
  52.                         handle the various menu selections.  If I had
  53.                         a gApplication object and real event dispatching,
  54.                         I wouldn't need this silly table.
  55.  
  56. AboutBox.cp                An important file, despite the fact that
  57.                         it doesn't do very much.
  58.  
  59.  
  60. The "Mini-application framework" is defined by the following
  61. sources:
  62.  
  63.  
  64. EventHandler.cp            Calls WaitNextEvent and dispatches events
  65.                         to the appropriate handlers.
  66.                         
  67. MenuHandler.cp            Manages application menus.  This code is
  68.                         old and rather sub-optimal, but it works
  69.                         well enough for a simple sample app.
  70.  
  71. WindowHandler.cp        Abstract code that defines a set of virtuals
  72.                         that are called by the event handler.  Includes
  73.                         a class for modeless dialog boxes that handles
  74.                         such things as changing the cursor shape to an
  75.                         I-beam when it passes over an EditText item.
  76.  
  77.  
  78. The primary utilities of note are:
  79.  
  80. AppleEventUtilities.cp    A stand-alone set of C++ wrappers for
  81.                         the AppleEvent manager.  Includes useful
  82.                         classes for accessing parameters in
  83.                         records, iterating items in lists, and
  84.                         building descriptors, lists and records.
  85.  
  86. Exceptions.cp            Very useful code that implements a failure
  87.                         handler with Try/Catch semantics.  (No dependancies)
  88.  
  89. ReportError.cp            Code that converts O.S. errors into descriptive
  90.                         strings.  Uses DialogUtilities and StringUtilities.
  91.                         Requires DLOG id 30303 and TEXT id 30303.
  92.  
  93. DialogUtilities.cp        Useful code that helps manage modal and modeless
  94.                         dialog boxes.  Requires StringUtilities.
  95.  
  96. NextEvent.cp            Old code that used to abstract WaitNextEvent
  97.                         vs. GetNextEvent for running on System 6 without
  98.                         MultiFinder (yes, very old code!).  Had some
  99.                         problems with native code, so now it just calls
  100.                         WaitNextEvent directly, and therefore is of
  101.                         marginal value.
  102.                         Uses MacUtilities.cp.
  103.  
  104. MacUtilities.cp            Simple, useful routines that many Macintosh
  105.                         applications will use.  (No dependancies)
  106.  
  107. StringUtilities.cp        Simple code that manages C and Pascal strings.
  108.                         Not as useful as a real string class, but better
  109.                         than nothing.  (No dependancies)
  110.  
  111.  
  112. And, a header not yet in the standard set but used by Zawphing:
  113.  
  114. FinderRegistry.h        Defines classes, properties, data types and
  115.                         error codes used by the Scriptable Finder.
  116.